home *** CD-ROM | disk | FTP | other *** search
- head 1.13;
- branch ;
- access ;
- symbols ;
- locks ; strict;
- comment @ * @;
-
-
- 1.13
- date 92.09.21.11.55.42; author mgbaker; state Exp;
- branches ;
- next 1.12;
-
- 1.12
- date 92.04.12.16.42.51; author mgbaker; state Exp;
- branches ;
- next 1.11;
-
- 1.11
- date 92.04.10.19.03.39; author mgbaker; state Exp;
- branches ;
- next 1.10;
-
- 1.10
- date 92.04.10.10.58.44; author mgbaker; state Exp;
- branches ;
- next 1.9;
-
- 1.9
- date 92.04.08.18.40.06; author mgbaker; state Exp;
- branches ;
- next 1.8;
-
- 1.8
- date 92.04.07.23.46.12; author mgbaker; state Exp;
- branches ;
- next 1.7;
-
- 1.7
- date 92.04.07.22.37.35; author mgbaker; state Exp;
- branches ;
- next 1.6;
-
- 1.6
- date 92.04.07.17.39.45; author mgbaker; state Exp;
- branches ;
- next 1.5;
-
- 1.5
- date 92.04.07.17.36.11; author mgbaker; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 92.01.07.17.44.44; author mgbaker; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 92.01.07.16.31.24; author mgbaker; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 91.09.24.12.51.39; author mgbaker; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 91.08.21.15.35.14; author mgbaker; state Exp;
- branches ;
- next ;
-
-
- desc
- @Temporary file - this is the user's Sys_StatsStub interface. This will
- go away when there's a proper syscall interface.
- @
-
-
- 1.13
- log
- @Comment.
- @
- text
- @/*
- * recovBox.h --
- *
- * External definitions needed by users of the fast recovery mechanism.
- *
- * Copyright (C) 1985 Regents of the University of California
- * All rights reserved.
- *
- *
- * $Header: /sprite/src/lib/include/RCS/recovBox.h,v 1.12 92/04/12 16:42:51 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
- */
-
- #include <sysStats.h>
-
- #ifndef _RECOV_BOX
- #define _RECOV_BOX
-
- /*
- * Parameters to Sys_StatsStub interface (should turn into system call
- * interface!!!!) to the recovery box. Only values from 0 to 99 may be
- * used by the recovery box and associated functions. The higher numbers
- * are used in the kernel recovery module and defined in recov.h.
- */
-
- #define RECOV_INIT_OBJ_TYPE 0
- #define RECOV_INSERT_OBJ 1
- #define RECOV_INSERT_ARRAY 2
- #define RECOV_DELETE_OBJ 3
- #define RECOV_UPDATE_OBJ 4
- #define RECOV_RETURN_OBJ 5
- #define RECOV_RETURN_ARRAY 6
- #define RECOV_RETURN_CONTENTS 7
- #define RECOV_GET_OBJECT_SIZE 8
- #define RECOV_MAP_TYPE 9
- #define RECOV_MAP_OBJ_NUM 10
- #define RECOV_TEST_ADD_DELETE 11
- #define RECOV_PRINT_REBOOT_TIMES 12
- #define RECOV_PRINT_SIZE 13
- #define RECOV_TOGGLE_CHECKSUM 14
- #define RECOV_TEST_ADD 15
-
- /*
- * For testing and timings. Used with RECOV_TEST_ADD_DELETE test.
- */
- typedef struct Recov_Timings {
- int iterations;
- int numHandles;
- } Recov_Timings;
-
- /*
- * An object's ID consists of its type number followed by its ID for that type.
- */
- typedef struct Recov_ObjectID {
- int typeID;
- int objectNumber;
- } Recov_ObjectID;
-
- /*
- * There is one entry in the table of contents for each object type. Each
- * entry states the size of the objects for that type, the maximum possible
- * number of objects for that type, and the current number for that type.
- * The index in the table of contents of this entry gives the number of the
- * object type. There is also a field called "applicationTypeID" used by
- * applications to access this type across crashes without needing to know
- * the order in which types were allocated. The application can hard-code
- * this number and use it to get the kernel's typeID for this type upon
- * restart.
- */
- typedef struct Recov_ContentsEntry {
- int objectSize; /* Size of these objects. */
- int applicationTypeID; /* Used by application. */
- int maxNumObjects; /* Max num of these objects. */
- int currentNum; /* Current num allocated. */
- int firstFree; /* First index free list. */
- } Recov_ContentsEntry;
-
- /*
- **************************************************************************
- * The following structures are all arguments to the interface to maniuplate
- * objects in the recovery box.
- **************************************************************************
- */
-
- /*
- * Information necessary to create a new object type. All the objects will
- * be of the same size, and you must specify the maximum number that will
- * ever exist at once. The applicationTypeID, described above, is passed
- * in via this structure.
- */
- typedef struct Recov_InitObjTypeArgs {
- int objectSize; /* Size of new objects. */
- int maxNumObjects; /* Maximum number of objects allowed. */
- int objectType; /* Out field. */
- int applicationTypeID; /* Application's ID to map to
- * to this type. Can be unset
- * (<= 0) or set (> 0). If set,
- * an error will be returned
- * if it's not unique. */
- int doChecksum; /* If 1, do checksum. If 0, don't. */
- } Recov_InitObjTypeArgs;
-
- /*
- * Information necessary to insert a new object. The field "objectPtr"
- * points to contents of the new object to insert.
- */
- typedef struct Recov_InsertObjArgs {
- int typeID; /* Type number of this object. */
- Address objectPtr; /* In field: Ptr to object to insert. */
- Recov_ObjectID objectID; /* Out field: new object's ID. */
- int applicationObjectNum;
- /* In field: Num that application
- * can use to get real objectID.
- * This is so that different
- * applications can point at
- * the same object without knowing the
- * order of inserts, etc. Also, the
- * application can guarantee the
- * uniqueness of the number. Can be
- * unset (<= 0) or set (>0). If set,
- * an error will be returned if there's
- * already an object of the same type
- * with this object ID. */
- } Recov_InsertObjArgs;
-
- /*
- * Information necessary to insert a set of new objects. This is a way
- * of inserting more than one object at a time without interference from
- * other processes doing similar object inserts. If the routine returns
- * with SUCCESS, then all the objects were inserted. If it returns FAILURE,
- * then no objects were inserted. If it panics, the results are undefined.
- */
- typedef struct Recov_InsertArrayArgs {
- int typeID; /* Type number of this object. */
- int numObjs; /* Number of objects to insert. */
- char *obuffer; /* In field: objects to insert. */
- int *applObjNums; /* In field: array of application's
- * object numbers for objects. May
- * be NIL. */
- Recov_ObjectID *objIDBuffer; /* Out field: array of new objects'
- * object IDs. */
- } Recov_InsertArrayArgs;
-
- /*
- * Information necessary to delete an object.
- */
- typedef struct Recov_DeleteObjArgs {
- Recov_ObjectID objectID; /* ID of the object to delete. */
- } Recov_DeleteObjArgs;
-
- /*
- * Information necessary to update an object. The field "objectPtr" points
- * to the new version of the object.
- */
- typedef struct Recov_UpdateObjArgs {
- Address objectPtr; /* In field: Ptr to object to insert. */
- Recov_ObjectID objectID; /* ID of the object to update. */
- } Recov_UpdateObjArgs;
-
- /*
- * Information necessary to return an object. The field "objectPtr" must
- * point to allocated memory of at least the size of this type of object.
- */
- typedef struct Recov_ReturnObjArgs {
- Address objectPtr; /* Out: Buffer for returning object. */
- Recov_ObjectID objectID; /* ID of the object to delete. */
- } Recov_ReturnObjArgs;
-
- /*
- * Information necessary to return all the objects of a given type.
- * There are 2 buffers returned: the first is the array of objects of the
- * given type, and the second is an array giving the ID's of the objects
- * of the corresponding index in the first buffer.
- * The "length" fields specify the current allocated lengths of the
- * return buffers. Upon successful return, the "length" fields will
- * specify how much of each buffer was used. Upon failure, the length
- * fields will specify the needed space for the buffers if the reason for
- * failure was that they weren't large enough.
- */
- typedef struct Recov_ReturnArrayArgs {
- int typeID; /* Type number of objects to return. */
- int olength; /* In/out field for buffer length. */
- char *obuffer; /* Out field for object array. */
- int ilength; /* In/out field for id buffer length. */
- char *ibuffer; /* Out field for object id array. */
- int alength; /* In/out field for appl. obj. nums. */
- char *abuffer; /* Out field for appl. obj. numbers. */
- } Recov_ReturnArrayArgs;
-
- /*
- * Information necessary to return the table of contents for the recovery box.
- * The field "length" specifies the current allocated length of the
- * return buffer. Upon successful return, the "length" field will
- * specify how much of that buffer was used. Upon failure, the length
- * field will specify the needed space for the buffer if the reason for
- * failure was that it wasn't large enough.
- */
- typedef struct Recov_ReturnTableArgs {
- int length; /* In/out field for buffer length. */
- char *buffer; /* Out field for contents buffer. */
- } Recov_ReturnTableArgs;
-
- /*
- * Information necessary to return the size of a given type of object in
- * the box.
- */
- typedef struct Recov_GetObjectSizeArgs {
- int typeID; /* In field to give object type. */
- int objectSize; /* Out field to return size. */
- } Recov_GetObjectSizeArgs;
-
- /*
- * Information necessary to map the application's type ID to the real type
- * ID used by the recovery box.
- */
- typedef struct Recov_MapTypeArgs {
- int applicationTypeID; /* In field: object type. */
- int typeID; /* Out field: real type. */
- } Recov_MapTypeArgs;
-
- /*
- * Information necessary to map the application's object number to the real
- * object number used by the recovery box.
- */
- typedef struct Recov_MapObjectNumArgs {
- int realTypeID; /* In: recov box's type for object */
- int applicationObjectNum; /* In: Obj numD to map from. */
- int realObjectNum; /* Out field: real obj num. */
- } Recov_MapObjectNumArgs;
-
-
- /*
- * Defines to make the system call interface look like a library interface,
- * since the sys call interface uses the gross Sys_Stats stuff.
- */
- #define RecovBox_InitObjType(/* (Recov_InitObjTypeArgs *) */ initArgsPtr) \
- Sys_Stats(SYS_RECOV_BOX, RECOV_INIT_OBJ_TYPE, (Address) initArgsPtr)
-
- #define RecovBox_InsertObj(/* (Recov_InsertObjArgs *) */ insertArgsPtr) \
- Sys_Stats(SYS_RECOV_BOX, RECOV_INSERT_OBJ, (Address) insertArgsPtr)
-
- #define RecovBox_InsertArray(/* (Recov_InsertObjArgs *) */ insertArrayArgsPtr)\
- Sys_Stats(SYS_RECOV_BOX, RECOV_INSERT_ARRAY, (Address) insertArrayArgsPtr)
-
- #define RecovBox_DeleteObj(/* (Recov_DeleteObjArgs *) */ deleteArgsPtr) \
- Sys_Stats(SYS_RECOV_BOX, RECOV_DELETE_OBJ, (Address) deleteArgsPtr)
-
- #define RecovBox_UpdateObj(/* (Recov_UpdateObjArgs *) */ updateArgsPtr) \
- Sys_Stats(SYS_RECOV_BOX, RECOV_UPDATE_OBJ, (Address) updateArgsPtr)
-
- #define RecovBox_ReturnObj(/* (Recov_ReturnObjArgs *) */ returnObjArgsPtr) \
- Sys_Stats(SYS_RECOV_BOX, RECOV_RETURN_OBJ, (Address) returnObjArgsPtr)
-
- #define RecovBox_ReturnArray(/* (Recov_ReturnArrayArgs *) */returnArrayArgsPtr)\
- Sys_Stats(SYS_RECOV_BOX, RECOV_RETURN_ARRAY, (Address) returnArrayArgsPtr)
-
- #define RecovBox_ReturnContents(/* (Recov_ReturnTableArgs *) */ \
- returnContentsArgsPtr)\
- Sys_Stats(SYS_RECOV_BOX, RECOV_RETURN_CONTENTS, \
- (Address) returnContentsArgsPtr)
-
- #define RecovBox_GetObjectSize(/* (Recov_GetObjectSizeArgs *) */ \
- getObjectSizeArgsPtr) \
- Sys_Stats(SYS_RECOV_BOX, RECOV_GET_OBJECT_SIZE, \
- (Address) getObjectSizeArgsPtr)
-
- #define RecovBox_MapType(/*(Recov_MapTypeArgs *)*/ mapTypeArgsPtr) \
- Sys_Stats(SYS_RECOV_BOX, RECOV_MAP_TYPE, (Address) mapTypeArgsPtr)
-
- #define RecovBox_MapObjectNum(/*(Recov_MapObjectNumArgs *)*/ \
- mapObjectNumArgsPtr) \
- Sys_Stats(SYS_RECOV_BOX, RECOV_MAP_OBJ_NUM, (Address) mapObjectNumArgsPtr)
-
-
- #endif /* _RECOV_BOX */
- @
-
-
- 1.12
- log
- @*** empty log message ***
- @
- text
- @d10 1
- a10 1
- * $Header: /sprite/src/lib/include/RCS/recovBox.h,v 1.11 92/04/10 19:03:39 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
- d20 3
- a22 1
- * interface!!!!) to the recovery box.
- @
-
-
- 1.11
- log
- @*** empty log message ***
- @
- text
- @d10 1
- a10 1
- * $Header: /sprite/src/lib/include/RCS/recovBox.h,v 1.10 92/04/10 10:58:44 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
- d97 1
- @
-
-
- 1.10
- log
- @*** empty log message ***
- @
- text
- @d10 1
- a10 1
- * $Header: /sprite/src/lib/include/RCS/recovBox.h,v 1.9 92/04/08 18:40:06 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
- d38 1
- @
-
-
- 1.9
- log
- @*** empty log message ***
- @
- text
- @d10 1
- a10 1
- * $Header: /sprite/src/lib/include/RCS/recovBox.h,v 1.8 92/04/07 23:46:12 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
- a54 4
- #define KEEP_FREE_INDICES 128 /* Indices into buffer of free objs.
- * Make this a multiple of ints in
- * size. */
-
- d71 1
- a71 4
- unsigned short firstIndex; /* First index in free objs. */
- unsigned short lastIndex; /* Last index in free objs. */
- unsigned char freeObjs[KEEP_FREE_INDICES];
- /* Last index in free objs. */
- @
-
-
- 1.8
- log
- @*** empty log message ***
- @
- text
- @d10 1
- a10 1
- * $Header: /sprite/src/lib/include/RCS/recovBox.h,v 1.7 92/04/07 22:37:35 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
- d55 4
- d75 4
- @
-
-
- 1.7
- log
- @*** empty log message ***
- @
- text
- @d10 1
- a10 1
- * $Header: /sprite/src/lib/include/RCS/recovBox.h,v 1.6 92/04/07 17:39:45 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
- d37 1
- @
-
-
- 1.6
- log
- @More stuff.
- @
- text
- @d10 1
- a10 1
- * $Header: /sprite/src/lib/include/RCS/recovBox.h,v 1.5 92/04/07 17:36:11 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
- d37 8
- @
-
-
- 1.5
- log
- @Before more stuff for testing and timing.
- @
- text
- @d10 1
- a10 1
- * $Header: /sprite/src/lib/include/RCS/recovBox.h,v 1.4 92/01/07 17:44:44 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
- d23 14
- a36 12
- #define RECOV_INIT_OBJ_TYPE 0
- #define RECOV_INSERT_OBJ 1
- #define RECOV_INSERT_ARRAY 2
- #define RECOV_DELETE_OBJ 3
- #define RECOV_UPDATE_OBJ 4
- #define RECOV_RETURN_OBJ 5
- #define RECOV_RETURN_ARRAY 6
- #define RECOV_RETURN_CONTENTS 7
- #define RECOV_GET_OBJECT_SIZE 8
- #define RECOV_MAP_TYPE 9
- #define RECOV_MAP_OBJ_NUM 10
- #define RECOV_TEST 11
- @
-
-
- 1.4
- log
- @Better comments.
- @
- text
- @d10 1
- a10 1
- * $Header: /sprite/src/lib/include/RCS/recovBox.h,v 1.3 92/01/07 16:31:24 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
- d25 10
- a34 5
- #define RECOV_DELETE_OBJ 2
- #define RECOV_UPDATE_OBJ 3
- #define RECOV_RETURN_OBJ 4
- #define RECOV_RETURN_ARRAY 5
- #define RECOV_RETURN_CONTENTS 6
- d49 5
- a53 1
- * object type.
- d56 4
- a59 3
- int objectSize;
- int numObjects;
- int currentNum;
- d72 2
- a73 1
- * ever exist at once.
- d75 1
- a75 1
- typedef struct Recov_InitObjType {
- d77 1
- a77 1
- int numObjects; /* Maximum number of objects allowed. */
- d79 6
- a84 1
- } Recov_InitObjType;
- d90 1
- a90 2
- typedef struct Recov_InsertObj {
- int objectSize; /* Size of the object. */
- d94 32
- a125 1
- } Recov_InsertObj;
- d130 1
- a130 1
- typedef struct Recov_DeleteObj {
- d132 1
- a132 1
- } Recov_DeleteObj;
- d138 1
- a138 2
- typedef struct Recov_UpdateObj {
- int objectSize; /* Size of the object to update. */
- d141 1
- a141 1
- } Recov_UpdateObj;
- d145 1
- a145 1
- * point to allocated memory of at least "objectSize" bytes.
- d147 1
- a147 2
- typedef struct Recov_ReturnObj {
- int objectSize; /* Size of the object to return. */
- d150 1
- a150 1
- } Recov_ReturnObj;
- d163 1
- a163 1
- typedef struct Recov_ReturnArray {
- d169 3
- a171 1
- } Recov_ReturnArray;
- d181 1
- a181 1
- typedef struct Recov_ReturnTable {
- d184 30
- a213 1
- } Recov_ReturnTable;
- d219 1
- a219 1
- #define Recov_InitObjType(/* (Recov_InitObjType *) */ initArgsPtr) \
- d222 1
- a222 1
- #define Recov_InsertObj(/* (Recov_InsertObj *) */ insertArgsPtr) \
- d225 4
- a228 1
- #define Recov_DeleteObj(/* (Recov_DeleteObj *) */ deleteArgsPtr) \
- d231 1
- a231 1
- #define Recov_UpdateObj(/* (Recov_UpdateObj *) */ updateArgsPtr) \
- d234 1
- a234 1
- #define Recov_ReturnObj(/* (Recov_ReturnObj *) */ returnObjArgsPtr) \
- d237 1
- a237 1
- #define Recov_ReturnArray(/* (Recov_ReturnArray *) */returnArrayArgsPtr) \
- d240 2
- a241 1
- #define Recov_ReturnContents(/* (Recov_ReturnTable *) */ returnContentsArgsPtr)\
- d244 12
- @
-
-
- 1.3
- log
- @Added library-like interface.
- @
- text
- @d10 1
- a10 1
- * $Header: /sprite/src/lib/include/RCS/recovBox.h,v 1.2 91/09/24 12:51:39 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
- d31 3
- d39 7
- d52 12
- d65 2
- a66 2
- int objectSize;
- int numObjects;
- d70 4
- d75 2
- a76 2
- int objectSize;
- int typeID;
- d78 1
- a78 1
- Recov_ObjectID objectID; /* Out field. */
- d81 3
- d85 1
- a85 1
- Recov_ObjectID objectID;
- d88 4
- d93 1
- a93 1
- int objectSize;
- d95 1
- a95 1
- Recov_ObjectID objectID;
- d98 4
- d103 3
- a105 3
- int objectSize;
- Address objectPtr; /* Out: Ptr to object to fill in. */
- Recov_ObjectID objectID;
- d108 11
- d120 1
- a120 1
- int typeID;
- d127 8
- @
-
-
- 1.2
- log
- @More definitions and stuff.
- @
- text
- @d10 1
- a10 1
- * $Header: /sprite/src/lib/include/RCS/recovBox.h,v 1.1 91/08/21 15:35:14 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
- d13 2
- d83 27
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d10 1
- a10 1
- * $Header: /sprite/src/kernel/cvsroot/kernel/recov/recov.h,v 9.15 90/11/29 23:04:05 kupfer Exp $ SPRITE (Berkeley)
- d25 3
- d34 6
- d43 1
- a43 1
- int objectType; /* In/out field. */
- d49 2
- a50 2
- Address objectPtr;
- Recov_ObjectID objectID; /* In/out field. */
- d59 1
- a59 1
- Address objectPtr;
- d62 19
- @
-